package day04;
import java.util.Scanner;
public class Guessing {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = (int)(Math.random()*1000+1);

        int guess;
        do {
            System.out.println("猜猜看吧!");
             guess = scan.nextInt();
             if(guess>num){
                 System.out.println("猜大了呦!");
             }else if (guess<num){
                 System.out.println("猜小了呦!");
             }else{
                 System.out.println("恭喜你猜对了!");
             }
        }while(guess!=num);

        /*假设num=666
       带入700 (大) 500 (小) 666(对)
         */

















        /*




        System.out.println("猜猜看吧!");
        int guess = scan.nextInt();
        while(guess!=num){
            if (guess>num){
                System.out.println("猜大了呦");
            }else{
                System.out.println("猜小了呦");
            }
            System.out.println("猜猜看吧!");
            guess = scan.nextInt();
        }
        System.out.println("恭喜你猜对了!");

         */
        /*
        500 小 猜
        600 小 猜
        700 大 猜
        650 小 猜
        660 小 猜
        670 大 猜
        665 小 猜
        666 false 循环结束
        继续执行
        恭喜你猜对了
         */
    }
}
